package com.zyl.controller;

import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;
import com.zyl.po.User;
import com.zyl.service.UserService;

import javax.annotation.Resource;

/**
 * @author zyl
 * @Description
 * @since 2024/2/21 10:53
 */
@RestController
@RequestMapping("/user")
public class  UserController {

    @Resource
    private UserService userService;

    @PostMapping("/details")
    public User details(Long id){
        User user = userService.getUser(id);
//        ModelAndView mv = new ModelAndView();
//        mv.setViewName("user/details");
//        mv.addObject("user",user);
        return user;
    }

}
